package com.glodon.paas.document.dao.mysql;

import org.springframework.beans.factory.annotation.Autowired;

import com.glodon.paas.document.dao.InvitationDao;
import com.glodon.paas.document.dao.domain.InvitationEntity;
import com.glodon.paas.document.dao.mapper.InvitationMapper;

public class InvitationDaoMysqlImpl implements InvitationDao {

    @Autowired
    private InvitationMapper invitationMapper;

    @Override
    public String insert(InvitationEntity entity) {
        invitationMapper.insert(entity);
        return entity.getMemberId();
    }

    @Override
    public InvitationEntity get(String id) {
        return null;
    }

    @Override
    public int delete(String id) {
        return 0;
    }

    @Override
    public InvitationEntity getInvitation(String userId, String token) {
        return invitationMapper.getInvitation(userId, token);
    }

    @Override
    public int updateInvitationStatus(String email, String token) {
        return invitationMapper.updateInvitationStatus(email,token);
    }

    @Override
    public int setInvitaionInvalid(String id) {
        return invitationMapper.setInvitaionInvalid(id);
    }

	public InvitationMapper getInvitationMapper() {
		return invitationMapper;
	}

	public void setInvitationMapper(InvitationMapper invitationMapper) {
		this.invitationMapper = invitationMapper;
	}

}
